package com.example.hangzhou.welbeing.mytestdemoapp.designPatterns.AdapterModel.adapter;

import com.example.hangzhou.welbeing.mytestdemoapp.designPatterns.AdapterModel.inter.AdvancedMediaPlayer;
import com.example.hangzhou.welbeing.mytestdemoapp.designPatterns.AdapterModel.inter.MediaPlayer;

/**
 * 杭州惟君医疗科技有限公司13
 * Created by 20433 on 2018/5/17
 *
 * @desc 东风山河绿，春已不折柳，繁花看不尽，处处惹人留
 * @desc 佛祖镇楼，bug辟容易
 */

public class MediaAdapter implements MediaPlayer {
    AdvancedMediaPlayer mAdvancedMediaPlayer;

    public MediaAdapter(String audioType) {
       switch ( audioType){
           case "vlc":
               mAdvancedMediaPlayer = new VlcPlayer();
           case "mp4":
               mAdvancedMediaPlayer = new Mp4Player();
       }
    }

    @Override
    public void play(String audioType, String fileName) {
        switch (audioType){
            case "vlc":
                mAdvancedMediaPlayer.playVlc(fileName);
            case "mp4":
                mAdvancedMediaPlayer.playMp4(fileName);
        }
    }
}
